package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread t = new Thread("l6") {
            public void run() {
                /*
                String get name 获取线程名字
                 */
                String name = this.getName();
                System.out.println(name);
                long id = this.getId();
                System.out.println(id);
                int priority = this.getPriority();
                System.out.println("优先级是"+priority);
                boolean isInterrupt = this.isInterrupted();
                boolean isLive = this.isAlive();
                boolean isDaemon = this.isDaemon();
                System.out.println("线程是否中断"+isInterrupt);
                System.out.println("线程是否活着"+isLive);
                System.out.println("线程是否是守护线程"+isDaemon);
            }
        };
        t.start();
    }
}
